using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace zuoye1
{
    public class Program
    {
        public static void Main(string[] args)
        {
            List<string> listA = new List<string> { "a", "b", "c", "d", "e" };
            List<string> listB = new List<string> { "d", "e", "f", "g", "h" };

            Console.WriteLine(string.Join(" ", listA));

            for (int i = 0; i < listB.Count; i++)
            {
                if (listA.Contains(listB[i]) == false)
                {
                    listA.Add(listB[i]);
                }
            }
            Console.WriteLine(string.Join(",", listA));
        }
    }
}
